package com.demo.business;

import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;

import androidx.annotation.NonNull;

import com.demo.R;
import com.keguoyu.easymvp.annotation.Receiver;
import com.keguoyu.easymvp.business.Business;

import io.reactivex.subjects.BehaviorSubject;

public class PasswordInputBusiness extends Business {

    private EditText nameInput;
    private EditText passwordInput;

    @Receiver("name")
    BehaviorSubject<String> nameSubject;


    @Override
    protected void doFindViewById(@NonNull View view) {
        super.doFindViewById(view);
        nameInput = (EditText) bindWidget(view, R.id.name_input);
        passwordInput = (EditText) bindWidget(view, R.id.password_input);
        nameInput.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {

            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
                nameSubject.onNext(s.toString());
            }

            @Override
            public void afterTextChanged(Editable s) {

            }
        });
    }



}
